<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('关联组织')" />
	<th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-area-edit">
			<div class="form-group" id="authDataScope">
				<div class="col-sm-11">
					<div id="deptTrees" class="ztree"></div>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: ztree-js" />
	<script type="text/javascript">
	
	    $(function() {
			var url = ctx + "system/dept/areaDeptTreeData";
			var options = {
				id: "deptTrees",
		        url: url,
		        check: { enable: true, nocheckInherit: false, chkboxType: { "Y": null, "N": null } },
				data: {
					key: {
						title: "title"         // 节点数据保存节点提示信息的属性名称
					},
					simpleData: {
						enable: true           // true / false 分别表示 使用 / 不使用 简单数据模式
					}
				},
		        expandLevel: 2,
		    };
			// $.tree.notAllowParents(options);
			$.tree.init(options);

	    });
		function submitHandler() {
			var deptIds = $.tree.getCheckedNodes();
			var deptNames = $.tree.getCheckedNodes("name");
			//子页面传值给父页面
			parent.window.setAssociationDept(deptIds,deptNames);
			$.modal.close();
		}
	</script>
</body>
</html>
